#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main_0008()
{
    int num;
    cin >> num;
    int a = num / 100;
    int b = (num % 100) / 10;
    int c = num % 10;
    if (num == pow(a, 3) + pow(b, 3) + pow(c, 3)) {
        cout << "YES";
    } else {
        cout << "NO";
    }
    return 0;
}
